package com.liang.consumer;

import com.liang.common.model.User;
import com.liang.common.service.UserService;
import com.liang.liangrpccore.proxy.ServiceProxyFactory;

public class ConsumerExample {

    public static void main(String[] args) {
        // 获取代理
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setUsername("liang");
        // 调用
        User newUser = userService.getUser(user);
        if (newUser != null){
            System.out.println("username: " + newUser.getUsername());
        } else {
            System.out.println("username is null");
        }
        long number = userService.getNumber();
        System.out.println(number);
    }
}
